﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright company="Microsoft Corporation" file="CultureComboItem.cs">
//   Copyright © Microsoft Corporation.  All Rights Reserved.  
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
// </copyright>
// <summary>
//   Culture Combobox item that returns combination of tag and Display Name as the title.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Microsoft.MCSUK.RESXTranslator
{
    using System.Globalization;

    /// <summary>
    /// Culture combo box item
    /// </summary>
    public class CultureComboItem
    {
        /// <summary>
        /// Theculture this item is representing
        /// </summary>
        private readonly CultureInfo culture;

        /// <summary>
        /// Initializes a new instance of the <see cref="CultureComboItem"/> class.
        /// </summary>
        /// <param name="culture">
        /// The culture.
        /// </param>
        public CultureComboItem(CultureInfo culture)
        {
            this.culture = culture;
        }

        /// <summary>
        /// Gets Culture.
        /// </summary>
        public CultureInfo Culture
        {
            get
            {
                return this.culture;
            }
        }

        /// <summary>
        /// Returns the string representation
        /// </summary>
        /// <returns>Formated name of the culture or the culture combo</returns>
        public override string ToString()
        {
            return string.Format("{0}  [{1}]  {2}", this.culture, this.culture.ThreeLetterWindowsLanguageName, this.culture.DisplayName);
        }
    }
}
